UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nddnb9f+VogAdBEre+PkddOS+8wzYiFW3yGK1QaygzU='
WHERE
key_id = '137bb34f233c2342970cea60c40dcf56cbacb6106bec27f63afc62ae1f7de4ec'
AND (
token = 'nddnb9f+VogAdBEre+PkddOS+8wzYiFW3yGK1QaygzU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)