UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sy7jcCbqd26i9+IQQ9qiQX/5c4mwHhgUo5gtVlBAxRI='
WHERE
key_id = '6f876b042e97d5af548b376d22462b73620d15a45819cdef0ee6d4e99e84db40'
AND (
token = 'sy7jcCbqd26i9+IQQ9qiQX/5c4mwHhgUo5gtVlBAxRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)