UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tu6ZLoKAf/SqasJk/aD3XhnzsGXMbMpRZJGIT0MKL+Q='
WHERE
key_id = 'f68edfb5364d573c0ef2ca447396551b34eec8fb5a58455c839ad277b233b6b7'
AND (
token = 'Tu6ZLoKAf/SqasJk/aD3XhnzsGXMbMpRZJGIT0MKL+Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)