UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4fkY/S1PPrEApa+tFfye/4XaA3/hmFrzUUxtquRVcLk='
WHERE
key_id = '39447708dcd4c6fe8d955cda811b3a7ee234db039cf27110ae2c383d991813e6'
AND (
token = '4fkY/S1PPrEApa+tFfye/4XaA3/hmFrzUUxtquRVcLk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)