UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fzlymVyoBDLaq2vVpRLULMxllwOLD2rmujI1RxcZSNo='
WHERE
key_id = '9c7065b0f83778971e9ed806d08294727c43796c27ffe6a56c567a520045d81c'
AND (
token = 'fzlymVyoBDLaq2vVpRLULMxllwOLD2rmujI1RxcZSNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)