UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f/KFtvAAfS5LdarQjw6RAJlzu2+434HRdzYapTAY22E='
WHERE
key_id = '6782ce05cf8eab7fcd1022a49921b9bba61f1cf80485dd0631e94696ab38a2ac'
AND (
token = 'f/KFtvAAfS5LdarQjw6RAJlzu2+434HRdzYapTAY22E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)