UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'usecVhoBa+CbQCUgWLkuzl5nCkDeZL8xh01WlsSeorM='
WHERE
key_id = '77208f764569a7ba38469a1ca57dabd2e5ea2543eec68362b6e1c417cffe825e'
AND (
token = 'usecVhoBa+CbQCUgWLkuzl5nCkDeZL8xh01WlsSeorM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)