UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vC2esmjNpqDBucPBYBgL5aoCn8HLRCJAmqVN+FS99jI=' 
WHERE 
  key_id = '45e2d81851f8be45480b544db3237c8172814eac45b747efff44a1240debc33a' 
  AND (
    token = 'vC2esmjNpqDBucPBYBgL5aoCn8HLRCJAmqVN+FS99jI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029