UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9o8+Hr18ojSJgtyfUA4+Nr7dSSR1b0RR5UirNuc9MRk=' 
WHERE 
  key_id = '4d5bcdc46dad28904c56fcea95d4d1a9dd7e58317d1ce581e344fd69ae73b31f' 
  AND (
    token = '9o8+Hr18ojSJgtyfUA4+Nr7dSSR1b0RR5UirNuc9MRk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039