UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aqA5AON4xnJhgb9iJrf0dJ3aQNn1fsO3/DUu8b9IIOk=' 
WHERE 
  key_id = 'ff32b3dbc7fc7f1201d9809958f08fda7a9319a2adf4862502bacfbcb01fcc41' 
  AND (
    token = 'aqA5AON4xnJhgb9iJrf0dJ3aQNn1fsO3/DUu8b9IIOk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033