UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '05bBqOlEyAFiTml5p/sdCNt5CbbVWdDus9Cz3b9O0uY=' 
WHERE 
  key_id = '76534a064541d4fc74a1cc28e63c1f2e466a045b5300a8815e78ae47f05a1b38' 
  AND (
    token = '05bBqOlEyAFiTml5p/sdCNt5CbbVWdDus9Cz3b9O0uY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049