UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iwsGhSKjTUnVg4TJSuy1qifvsscl8cDBOdrI/8a1nAA=' 
WHERE 
  key_id = '7ea4a6587510e013c979c3735784fe02edbaedbecb4109368b13354073e152c1' 
  AND (
    token = 'iwsGhSKjTUnVg4TJSuy1qifvsscl8cDBOdrI/8a1nAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041