UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JCrUIamC6drg250SMVTlSWuJ9HNXHgVfs2WR2CUKg6g='
WHERE
key_id = '8dce6c76f577fa622cd03624685cdaee5498d60f9d8d6bfed97411f83dde4b63'
AND (
token = 'JCrUIamC6drg250SMVTlSWuJ9HNXHgVfs2WR2CUKg6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)