UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BtdgkMxUvCr8QpJtc6stqoyXEaUZ+4QyBU9ERoWW8xc=' 
WHERE 
  key_id = '88115115af1207b1a92c54fe63916f5965cbaede1307f5d88031385180d2c516' 
  AND (
    token = 'BtdgkMxUvCr8QpJtc6stqoyXEaUZ+4QyBU9ERoWW8xc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026