UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Abx17LP8fPRzaCwJxyn9uC5RQ2uH+rsqPoZb1gkPE8E=' 
WHERE 
  key_id = '0626781f953f85bbdfc7b9583c6c50a8e234c0b0159c9fbb19fc9750af479e7b' 
  AND (
    token = 'Abx17LP8fPRzaCwJxyn9uC5RQ2uH+rsqPoZb1gkPE8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051