UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tlUsnot37M/yo85oKKnl5VhNH4FCAI+9dsM07xS/4h0=' 
WHERE 
  key_id = '020c3c50e387e1c89ddf405ca1c7f97ead22771280ace9068cfab4abae23bc73' 
  AND (
    token = 'tlUsnot37M/yo85oKKnl5VhNH4FCAI+9dsM07xS/4h0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035