UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1JYAhZK1nPtvw+3++iNjAtpeVcyXPqWBTgayKRrEtKI='
WHERE
key_id = 'f8423bffcb3ab1e2ae952fc8b0dd16ff0afd682d232c176871b7679dcb4e054a'
AND (
token = '1JYAhZK1nPtvw+3++iNjAtpeVcyXPqWBTgayKRrEtKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)