UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KnHjxDMqKORJ/aswKUCAj/RdvgZe/jXbXLXluQ3Gj6I=' 
WHERE 
  key_id = 'ef89a285642e59b92fd24c26a0b1cd2e6eea1772a77e35169127a9ba17e2ed4a' 
  AND (
    token = 'KnHjxDMqKORJ/aswKUCAj/RdvgZe/jXbXLXluQ3Gj6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027