UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vpDGtZRKvEwAe09zta9RWNN0ND7Sjy1keQHHqWmcXCM='
WHERE
key_id = 'b10643b5a7c8a3e089ccdcdab84363a69acffbc3cc9241792de03e3eca7b9aff'
AND (
token = 'vpDGtZRKvEwAe09zta9RWNN0ND7Sjy1keQHHqWmcXCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)