UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kT+dK1SecbEUw3ZzQOcTFbJncBSPS0X6loF2P63JGFo='
WHERE
key_id = '7edbce8cf2e40616644fa2774413e5ad048cde893e7fc2ca6508a1df9ea5e79a'
AND (
token = 'kT+dK1SecbEUw3ZzQOcTFbJncBSPS0X6loF2P63JGFo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)