UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd//b3AcmPBx9IId72jR1tKNF+hQLmBqQKXsg/0N2ZgA='
WHERE
key_id = 'dfd929e43406025576b018016d221480d4722ec0ee1b63b009ab8db6d44cadc5'
AND (
token = 'd//b3AcmPBx9IId72jR1tKNF+hQLmBqQKXsg/0N2ZgA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)