UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FwHF07AdIM6mQ4V+Ky8fABwYI0utIta+g9RereAjkAk=' 
WHERE 
  key_id = '0c3a12a33cc98c38beae7f51547ae3bf64c4b2ba3f73ed5f02b82539997ecb91' 
  AND (
    token = 'FwHF07AdIM6mQ4V+Ky8fABwYI0utIta+g9RereAjkAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040