UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1tOnCdftpSuvKdCoqJEX/K581FR0PiOT374wNgAlb3w=' 
WHERE 
  key_id = 'c22f4b118848261eff90669f34421d5af5199611874935d0ebae896784f5448c' 
  AND (
    token = '1tOnCdftpSuvKdCoqJEX/K581FR0PiOT374wNgAlb3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023