UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '55caIfMXlnKqIluoHVD7FSCeByqQxxdw+ZLDXW8cr0k=' 
WHERE 
  key_id = '91a9b5ebc3af09d96ace27951725730e4873b2150d4a3edd60e490d829f2620c' 
  AND (
    token = '55caIfMXlnKqIluoHVD7FSCeByqQxxdw+ZLDXW8cr0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037