UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iG4A7GLqSB1cZItfVOLZdOxnFt9r8MtrqCi2xn2PgME=' 
WHERE 
  key_id = 'e6c2c42d20ecdc8026bcbcc4f0e284e49a38bffba216ba6a6cd243e0c70c8510' 
  AND (
    token = 'iG4A7GLqSB1cZItfVOLZdOxnFt9r8MtrqCi2xn2PgME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029