UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5j5iagq54yGqMD06DckaeDGOGQk3iR69HiiMxKqOZ8A='
WHERE
key_id = '19bbb05725470c75886c7c033cc6985f2c868205b42bfb4f7f5e0758c48de4f9'
AND (
token = '5j5iagq54yGqMD06DckaeDGOGQk3iR69HiiMxKqOZ8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)