UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gdzavyrvKZb+kWKO8+RVfPfoeI48AwAmRyvI7d6Zdmw=' 
WHERE 
  key_id = 'a6827d1ec77b1f283716f4f3370064f27585dcb825cc7a011a330c93a5bf449f' 
  AND (
    token = 'gdzavyrvKZb+kWKO8+RVfPfoeI48AwAmRyvI7d6Zdmw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031