UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5ZtshrWyWNFYDEYRthmsyVazQQk/LU4GLQsZ8a42PMA='
WHERE
key_id = 'bfbb4721fc1112d6965e53344c2b65f369962baa846a47c8e31c4ea60a3707eb'
AND (
token = '5ZtshrWyWNFYDEYRthmsyVazQQk/LU4GLQsZ8a42PMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)