UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uC7myntTigtzkx0vFlXxAHg6pKkbgnBInw1cnPjzpPw=' 
WHERE 
  key_id = '3ed0d5c86f6357e24e2230b3e1f6684297fa628193e7ca56c11755586390ddfe' 
  AND (
    token = 'uC7myntTigtzkx0vFlXxAHg6pKkbgnBInw1cnPjzpPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055