UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TlpXm8lDLXmHcT9eIk5aCGnYGE6Qnb6+itCr5NZTKCc='
WHERE
key_id = '3b48e2e5832c39dcf40ae55a03584ad9eef9eca28df8aea7efcebcdde071b100'
AND (
token = 'TlpXm8lDLXmHcT9eIk5aCGnYGE6Qnb6+itCr5NZTKCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)