UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z3xGlcz7Aqn805sUZiKwv0UWtdAukyLfp1EIYm4FkCk=' 
WHERE 
  key_id = '33f361fc8e23274c2838b3af29763e2ebf2a872597f34bec0b311dd7912e5c11' 
  AND (
    token = 'z3xGlcz7Aqn805sUZiKwv0UWtdAukyLfp1EIYm4FkCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016