UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8SBKsbmvDvdc/cIIzTYEXyNu7GHXKr/ruehdpKsWeMg=' 
WHERE 
  key_id = 'dc6b12ba9df040b35593410eed393463789c6ae9c410bf95f546b50cb96f8071' 
  AND (
    token = '8SBKsbmvDvdc/cIIzTYEXyNu7GHXKr/ruehdpKsWeMg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047