UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GCAhhdgCnf4pE4BYFqVrLb71dE/+UbHNeifxWOvOKIw=' 
WHERE 
  key_id = '3b805abfbfb577dfd702371d18212ce80c261dcba2c07df32658fa82ad355e1f' 
  AND (
    token = 'GCAhhdgCnf4pE4BYFqVrLb71dE/+UbHNeifxWOvOKIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045